<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
    <script src="js/echatjs.js"></script>
</head>
<body>
<div id="main" style="width: 600px;height:400px;"></div>
<script type="text/javascript">
    var myChart = echarts.init(document.getElementById('main'));
    option = {
        title: {
            text: '本周气温表',
            left: 'center'
        },
        tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c}'
        },
        legend: {
            left: 'left',
            data: ['当日气温', '平均气温']
        },
        xAxis: {
            type: 'category',
            name: 'x',
            splitLine: { show: false },
            data: ['周一', '周二', '周三', '周四', '周五', '周六', '周七']
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        yAxis: {
            type: 'value',
            name: 'y'
        },
        series: [
//            {
//                name: '平均气温',
//                type: 'line',
//                data: [1, 3, 9, 10, 13, 17, 16]
//            },
            {
                name: '当日气温',
                type: 'line',
                data: [6, 8, 15, 8, 16, 17, 15],
                markLine: {
                    name:'平均气温',
                    data: [
                        {type: "average",name: "平均值"}
                    ]
                }
            },
//            {
//                name: '1/2的指数',
//                type: 'line',
//                data: [1 / 2, 1 / 4, 1 / 8, 1 / 16, 1 / 32, 1 / 23, 1 / 24,]
//            }

        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
</body>
</html>